//
//  HistoryOrderCell.m
//  YouthHostel
//
//  Created by administrator on 16/10/12.
//  Copyright © 2016年 Lorain mac pro. All rights reserved.
//

#import "HistoryOrderCell.h"
#import "Define.h"
@implementation HistoryOrderCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.nameLab = [[UILabel alloc]init];
        self.nameLab.textColor = [UIColor blackColor];
        self.nameLab.textAlignment = NSTextAlignmentLeft;
        self.nameLab.font = [UIFont systemFontOfSize:15];
        
        self.hotelImg = [[UIImageView alloc]init];
        
        self.alreadyLab = [[UILabel alloc]init];
        self.alreadyLab.textColor = [UIColor blackColor];
        self.alreadyLab.textAlignment = NSTextAlignmentLeft;
        self.alreadyLab.font = [UIFont systemFontOfSize:15];
        
        self.leaveLab = [[UILabel alloc]init];
        self.leaveLab.textColor = [UIColor blackColor];
        self.leaveLab.textAlignment = NSTextAlignmentLeft;
        self.leaveLab.font = [UIFont systemFontOfSize:15];
        
        self.peaceLab = [[UILabel alloc]init];
        self.peaceLab.textColor = [UIColor blackColor];
        self.peaceLab.textAlignment = NSTextAlignmentLeft;
        self.peaceLab.font = [UIFont systemFontOfSize:15];
        
        self.getInfoBtn = [[UIButton alloc]init];
        [self.getInfoBtn setTitle:@"查看" forState:0];
        self.getInfoBtn.backgroundColor = [UIColor colorWithRed:56/255.0 green:143/255.0 blue:214/255.0 alpha:1];
        [self.getInfoBtn setTitleColor:[UIColor whiteColor] forState:0];
        self.getInfoBtn.layer.cornerRadius = 5;
        self.getInfoBtn.clipsToBounds = YES;
        
        self.judgeBtn = [[UIButton alloc]init];
        [self.judgeBtn setTitle:@"评价" forState:0];
        self.judgeBtn.backgroundColor = [UIColor colorWithRed:56/255.0 green:143/255.0 blue:214/255.0 alpha:1];
        [self.judgeBtn setTitleColor:[UIColor whiteColor] forState:0];
        self.judgeBtn.layer.cornerRadius = 5;
        self.judgeBtn.clipsToBounds = YES;

        
        self.lineLab = [[UILabel alloc]init];
        self.lineLab.backgroundColor = [UIColor groupTableViewBackgroundColor];
        
        [self.contentView addSubview:_nameLab];
        [self.contentView addSubview:_hotelImg];
        [self.contentView addSubview:_alreadyLab];
        [self.contentView addSubview:_leaveLab];
        [self.contentView addSubview:_peaceLab];
        [self.contentView addSubview:_getInfoBtn];
        [self.contentView addSubview:_judgeBtn];
        [self.contentView addSubview:_lineLab];

    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.nameLab.frame = CGRectMake(20, 20, WIDTH, 30);
    
    self.hotelImg.frame = CGRectMake(20, 60, 90, 80);
    
    self.alreadyLab.frame = CGRectMake(120, 60, WIDTH-120, 30);
    
    self.leaveLab.frame = CGRectMake(120, 90, WIDTH-120, 30);
    
    self.peaceLab.frame = CGRectMake(120, 120, WIDTH-120, 30);
    
    self.getInfoBtn.frame = CGRectMake(WIDTH-160, 140, 60, 30);
    
    self.judgeBtn.frame = CGRectMake(WIDTH-80, 140, 60, 30);
    
    self.lineLab.frame = CGRectMake(0, 50, WIDTH, 1);
}
@end
